package cn.tedu.javagame.FirePlane;

import java.awt.*;

//定义一个抽象类
public abstract class FlyObject {
    int x,y;
    int speed;
    static Image img;
    static Image[]  imgs;
    public FlyObject(){
        this.x =(int)(Math.random()*(ShootFrame.WIDTH-img.getWidth(null)));
        this.y =  -img.getHeight(null);
        this.speed = (int)(Math.random()*5+2);
    };
    public abstract void move();
    int index = -1;
    public void step(){
        index++;
        if(index==Integer.MAX_VALUE){index=-1;}
        this.img = this.imgs[index++/10%this.imgs.length];
    }
}
